<template>
	<view class="i_detail">
		<!-- <view class="flex date">
			<view class="d_image flex">
				<image src="../../static/35.png" alt="">
				2022年10月
			</view>
			<view class="">
				获得：500  使用：300
			</view>
		</view> -->
		<view class="b_p">
			<view class="" v-for="(item,index) in  points.data" :key="index">
				<view class="s-list flex">
					<view class="">
						<view class="s_title">
							{{item.describe}}
						</view>
						<view class="s_date">
							{{item.create_time}}
						</view>
					</view>
					<view class="s_balance" :class="[item.value > 0 ? 's_balance' : 's_balance_f']">
						{{ item.value > 0 ? '+' : '' }}{{ item.value }}
					</view>
				</view>
				<view class="line">

				</view>
			</view>
			<!-- <view class="">
				<view class="s-list flex">
					<view class="">
						<view class="s_title">
							完成每日签到
						</view>
						<view class="s_date">
							2022-05-06 15:00
						</view>
					</view>
					<view class="s_balance_f">
						-500
					</view>
				</view>
				<view class="line">
			
				</view>
			</view> -->

		</view>
	</view>
</template>

<script>
	import * as Api from '@/api/recovery'
	export default{
		data(){
			return{
				points:{}
			}
		},
		onLoad() {
			this.getList()
		},
		methods:{
			getList(){
				const app = this
				return new Promise((resolve, reject) => {
				  Api.getPoints()
				    .then(result => {
				      app.points = result.data.list
					  console.log(app.points)
				      resolve(app.points)
				    })
				})
				
			}
		}
	}
</script>

<style>
	.flex {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.d_image{
		
	}
	.d_image image{
		width: 46rpx;
		height: 46rpx;
		margin-right: 20rpx;
	}
	.date{
		padding: 24rpx 32rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}
	.s_title {
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-bottom: 28rpx;
	}

	.s_balance {
		font-size: 40rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFB823;
	}
	.s_balance_f {
		font-size: 40rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #66B347;
	}

	.s-list {
		margin-bottom: 40rpx;
	}

	.s_date {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #999999;
	}

	.b_p {
		padding: 40rpx 34rpx;
		background-color: #FFFFFF;
	}

	.line {
		width: 100%;
		height: 1px;
		background: #F5F5F5;
		margin: 10rpx 0;
	}
</style>
